angular.module("app")
	.controller('pieCtrl', ['$scope', function($scope) {
		
		console.log('pie控制器');

		var pieData = [{
				value: 335,
				name: '直达'
			},
			{
				value: 679,
				name: '营销广告'
			},
			{
				value: 1548,
				name: '搜索引擎'
			}
		];

		var dataTest = {
			value: 1548,
			name: '360浏览器'
		};

		$scope.dataPie = pieData;

		$scope.dataRing = angular.copy(pieData);

		$scope.addPie = function() {
			if($scope.dataPie.indexOf(dataTest) < 0) {
				$scope.dataPie.push(dataTest);
			}

		}

		$scope.setData = function() {
			if($scope.dataRing.indexOf(dataTest) < 0) {
				$scope.dataRing.push(dataTest);
			}
		}

	}]);